<?php
namespace App\Listener;

use App\Common as com;
use Hyperf\Command\Event;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;

#[Listener]
class CommonListener implements ListenerInterface {

	public function listen():array {
		// 返回一个该监听器要监听的事件数组，可以同时监听多个事件
		return [
			Event\FailToHandle::class,
		];
	}

	/**
	 * @param Event\FailToHandle $event
	 * @return void
	 */
	public function process( object $event ):void {
		com\Lib\Err\Exception::showSimpleShowExceptionInfo( $event->getThrowable() );
	}

}